package fr.upmc.i3s.upmcontact.listeners;

import fr.upmc.i3s.upmcontact.contents.LostFoundObject;
import fr.upmc.i3s.upmcontact.views.dialogs.ObjectDetailsDialog;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.View.OnClickListener;

public class OnObjectClickListener implements OnClickListener {
	
	private Fragment context;
	private LostFoundObject lfo;
	private int requestId;
	
	public OnObjectClickListener(Fragment context, LostFoundObject lfo, int requestId) {
		this.context = context;
		this.lfo = lfo;
		this.requestId = requestId;
	}

	@Override
	public void onClick(View v) {
		Intent intent = new Intent(context.getActivity(), ObjectDetailsDialog.class);
		intent.putExtra(ObjectDetailsDialog.PARAM_OBJECT, lfo);
		context.startActivityForResult(intent, requestId);
	}

}
